/**
 * Bestpay.com.cn Inc.
 * Copyright (c) 2011-2020 All Rights Reserved.
 */
package com.suxiaoxiao.springbootlearn.designpattern.statepattern.goodcode.test;

import com.suxiaoxiao.springbootlearn.designpattern.statepattern.goodcode.pojo.GumballMachine;
import com.suxiaoxiao.springbootlearn.designpattern.statepattern.goodcode.rmi.server.GumballMachineRemote;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

/**
 * desc
 *
 * @author zhaorongzhang
 * @version GumballMachineTestDrive.java, v 0.1 2020/1/11 10:21 下午 zhaorongzhang Exp $$
 */
public class GumballMachineTestDrive {

    public static void main(String[] args) {
        GumballMachineRemote gumballMachine = null;
        int count = 5;
        String path = "www.zhaorongzhang.com";
        Registry registry = null;

        try {
            registry = LocateRegistry.createRegistry(1099);
            gumballMachine = new GumballMachine(path, count);
            registry.rebind("gumballMachine", gumballMachine);
            System.out.println("rmi server starting......");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}